<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>异常处理-throw抛出异常</title>
</head>

<body>
  <script>
    // ============================== 异常处理 - throw抛出异常 ==============================

    function count(x, y) {
      if (!x || !y) {
        throw new Error	
      }
      return x * y
    }
    console.log(count(10, 20))
    console.log(count())
  </script>
</body>

</html>